package cn.tedu._07springaop.aop;

import org.springframework.stereotype.Component;

@Component
public class CalculatorIml implements Calculator{
    @Override
    public int add(int m, int n) {
        //手动抛出异常,用于测试异常通知AfterThrowing
//        if (m>0){
//            throw new IllegalArgumentException("m不能大于0");
//        }
        int result = m+n;
        return result;
    }

    @Override
    public int sub(int m, int n) {
        int result = m-n;
        return result;
    }

    @Override
    public int mul(int m, int n) {
        int result = m*n;
        return result;
    }

    @Override
    public int div(int m, int n) {
        int result = m/n;
        return result;
    }
}
